import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import svgr from "vite-plugin-svgr"

// https://vite.dev/config/
export default defineConfig({
  plugins: [
    react(), 
    svgr(),
  ],
  server: {
    proxy: {
      '/16pic': {
        target: 'https://photo.16pic.com',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/16pic/, '')
      },
      '/baiduImage': {
        target: 'https://img1.baidu.com',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/baiduImage/, '')
      },
    },
  }
})
